package com.example.cloud.model.finance;

import com.example.cloud.model.common.CommonModel;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Transient;
import java.math.BigDecimal;

/**
 * Created by wangtao on 2018/7/30.
 * 待交费记录
 */
@Entity(name = "finance_wait_payment")
@Data
@EqualsAndHashCode(callSuper = false)
public class WaitPayment extends CommonModel {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    // 患者主键
    @Column(name = "patient_id")
    private Long patientId;
    // 会员主键
    @Column(name = "member_id")
    private Long memberId;
    // 会员名称
    @Column(name = "member_name")
    private String memberName;
    // 业务类型
    @Column(name = "business_type")
    private int businessType;
    // 关联业务主键
    @Column(name = "business_id")
    private Long businessId;
    // 关联业务名称
    @Column(name = "business_name")
    private String businessName;
    // 购买单价
    @Column(name = "price")
    private BigDecimal price;
    // 购买数量
    @Column(name = "quantity")
    private int quantity;
    // 总费用
    @Column(name = "total_amount")
    private BigDecimal totalAmount;
    // 已交费
    @Column(name = "pay_amount")
    private BigDecimal payAmount;
    // 本次交费
    @Transient
    private BigDecimal thisPayAmount = BigDecimal.ZERO;
}
